package com.hucsmn.phone;

/**
 * 抽象套餐类。
 */
public abstract class Plan {
    /**
     * 套餐每月资费。
     */
    private double cost;

    protected Plan() {
    }

    protected Plan(double cost) {
        setCost(cost);
    }

    /**
     * 显示所有套餐信息。
     */
    public abstract void show();

    public double getCost() {
        return cost;
    }

    public void setCost(double cost) {
        if (!Double.isFinite(cost)) {
            throw new IllegalArgumentException();
        }
        this.cost = cost;
    }
}
